home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / Power.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  26.4 KB  |  688 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        Power.h
  3.  
  4.      Contains:    Power Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc.  All rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __POWER__
  19. #define __POWER__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __MIXEDMODE__
  25. #include <MixedMode.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50.  
  51. enum {
  52.                                                                 /* Bit positions for ModemByte */
  53.     modemOnBit                    = 0,
  54.     ringWakeUpBit                = 2,
  55.     modemInstalledBit            = 3,
  56.     ringDetectBit                = 4,
  57.     modemOnHookBit                = 5
  58. };
  59.  
  60.  
  61. enum {
  62.                                                                 /* masks for ModemByte */
  63.     modemOnMask                    = 0x01,
  64.     ringWakeUpMask                = 0x04,
  65.     modemInstalledMask            = 0x08,
  66.     ringDetectMask                = 0x10,
  67.     modemOnHookMask                = 0x20
  68. };
  69.  
  70.  
  71. enum {
  72.                                                                 /* bit positions for BatteryByte */
  73.     chargerConnBit                = 0,
  74.     hiChargeBit                    = 1,
  75.     chargeOverFlowBit            = 2,
  76.     batteryDeadBit                = 3,
  77.     batteryLowBit                = 4,
  78.     connChangedBit                = 5
  79. };
  80.  
  81.  
  82. enum {
  83.                                                                 /* masks for BatteryByte */
  84.     chargerConnMask                = 0x01,
  85.     hiChargeMask                = 0x02,
  86.     chargeOverFlowMask            = 0x04,
  87.     batteryDeadMask                = 0x08,
  88.     batteryLowMask                = 0x10,
  89.     connChangedMask                = 0x20
  90. };
  91.  
  92.  
  93. enum {
  94.                                                                 /* bit positions for SoundMixerByte */
  95.     MediaBaySndEnBit            = 0,
  96.     PCISndEnBit                    = 1,
  97.     ZVSndEnBit                    = 2,
  98.     PCCardSndEnBit                = 3
  99. };
  100.  
  101.  
  102. enum {
  103.                                                                 /* masks for SoundMixerByte */
  104.     MediaBaySndEnMask            = 0x01,
  105.     PCISndEnMask                = 0x02,
  106.     ZVSndEnMask                    = 0x04,
  107.     PCCardSndEnMask                = 0x08
  108. };
  109.  
  110.  
  111. enum {
  112.                                                                 /* commands to SleepQRec sleepQProc */
  113.     sleepRequest                = 1,
  114.     sleepDemand                    = 2,
  115.     sleepWakeUp                    = 3,
  116.     sleepRevoke                    = 4,
  117.     sleepUnlock                    = 4,
  118.     sleepDeny                    = 5,
  119.     sleepNow                    = 6,
  120.     dozeDemand                    = 7,
  121.     dozeWakeUp                    = 8,
  122.     dozeRequest                    = 9
  123. };
  124.  
  125.  
  126. enum {
  127.                                                                 /* SleepQRec.sleepQFlags */
  128.     noCalls                        = 1,
  129.     noRequest                    = 2,
  130.     slpQType                    = 16,
  131.     sleepQType                    = 16
  132. };
  133.  
  134. /* bits in bitfield returned by PMFeatures */
  135.  
  136. enum {
  137.     hasWakeupTimer                = 0,                            /* 1=wakeup timer is supported                                */
  138.     hasSharedModemPort            = 1,                            /* 1=modem port shared by SCC and internal modem            */
  139.     hasProcessorCycling            = 2,                            /* 1=processor cycling is supported                            */
  140.     mustProcessorCycle            = 3,                            /* 1=processor cycling should not be turned off                */
  141.     hasReducedSpeed                = 4,                            /* 1=processor can be started up at reduced speed            */
  142.     dynamicSpeedChange            = 5,                            /* 1=processor speed can be switched dynamically            */
  143.     hasSCSIDiskMode                = 6,                            /* 1=SCSI Disk Mode is supported                            */
  144.     canGetBatteryTime            = 7,                            /* 1=battery time can be calculated                            */
  145.     canWakeupOnRing                = 8,                            /* 1=can wakeup when the modem detects a ring                */
  146.     hasDimmingSupport            = 9,                            /* 1=has dimming support built in (DPMS standby by default)    */
  147.     hasStartupTimer                = 10,                            /* 1=startup timer is supported                                */
  148.     hasChargeNotification        = 11,                            /* 1=client can determine of charge connect status change notifications available */
  149.     hasDimSuspendSupport        = 12                            /* 1=supports dimming LCD and CRT to DPMS suspend state        */
  150. };
  151.  
  152. /* bits in bitfield returned by GetIntModemInfo and set by SetIntModemState */
  153.  
  154. enum {
  155.     hasInternalModem            = 0,                            /* 1=internal modem installed                        */
  156.     intModemRingDetect            = 1,                            /* 1=internal modem has detected a ring                */
  157.     intModemOffHook                = 2,                            /* 1=internal modem is off hook                        */
  158.     intModemRingWakeEnb            = 3,                            /* 1=wakeup on ring is enabled                        */
  159.     extModemSelected            = 4,                            /* 1=external modem selected                        */
  160.     modemSetBit                    = 15                            /* 1=set bit, 0=clear bit (SetIntModemState)        */
  161. };
  162.  
  163. /* bits in BatteryInfo.flags                                     */
  164. /* ("chargerConnected" doesn't mean the charger is plugged in)    */
  165.  
  166. enum {
  167.     batteryInstalled            = 7,                            /* 1=battery is currently connected                    */
  168.     batteryCharging                = 6,                            /* 1=battery is being charged                        */
  169.     chargerConnected            = 5                                /* 1=charger is connected to the PowerBook            */
  170. };
  171.  
  172.  
  173. enum {
  174.     HDPwrQType                    = 0x4844,                        /* 'HD' hard disk spindown queue element type        */
  175.     PMgrStateQType                = 0x504D                        /* 'PM' Power Manager state queue element type        */
  176. };
  177.  
  178. /* client notification bits in PMgrQueueElement.pmNotifyBits */
  179.  
  180. enum {
  181.     pmSleepTimeoutChanged        = 0,
  182.     pmSleepEnableChanged        = 1,
  183.     pmHardDiskTimeoutChanged    = 2,
  184.     pmHardDiskSpindownChanged    = 3,
  185.     pmDimmingTimeoutChanged        = 4,
  186.     pmDimmingEnableChanged        = 5,
  187.     pmDiskModeAddressChanged    = 6,
  188.     pmProcessorCyclingChanged    = 7,
  189.     pmProcessorSpeedChanged        = 8,
  190.     pmWakeupTimerChanged        = 9,
  191.     pmStartupTimerChanged        = 10,
  192.     pmHardDiskPowerRemovedbyUser = 11,
  193.     pmChargeStatusChanged        = 12,
  194.     pmPowerLevelChanged            = 13
  195. };
  196.  
  197. /* System Activity Selectors */
  198.  
  199. enum {
  200.     OverallAct                    = 0,                            /* general type of activity                            */
  201.     UsrActivity                    = 1,                            /* user specific type of activity                    */
  202.     NetActivity                    = 2,                            /* network specific activity                        */
  203.     HDActivity                    = 3                                /* Hard Drive activity                                */
  204. };
  205.  
  206. /* Storage Media sleep mode defines */
  207.  
  208. enum {
  209.     kMediaModeOn                = 0,                            /* Media active (Drive spinning and at full power)    */
  210.     kMediaModeStandBy            = 1,                            /* Media standby (not implemented)    */
  211.     kMediaModeSuspend            = 2,                            /* Media Idle (not implemented)    */
  212.     kMediaModeOff                = 3                                /* Media Sleep (Drive not spinning and at min power, max recovery time)    */
  213. };
  214.  
  215.  
  216. enum {
  217.     kMediaPowerCSCode            = 70
  218. };
  219.  
  220.  
  221. /* definitions for HDQueueElement.hdFlags    */
  222.  
  223. enum {
  224.     kHDQueuePostBit                = 0,                            /* 1 = call this routine on the second pass        */
  225.     kHDQueuePostMask            = (1 << kHDQueuePostBit)
  226. };
  227.  
  228.  
  229. struct ActivityInfo {
  230.     short                             ActivityType;                /* Type of activity to be fetched.  Same as UpdateSystemActivity Selectors */
  231.     unsigned long                     ActivityTime;                /* Time of last activity (in ticks) of specified type. */
  232. };
  233. typedef struct ActivityInfo                ActivityInfo;
  234. /* information returned by GetScaledBatteryInfo */
  235.  
  236. struct BatteryInfo {
  237.     UInt8                             flags;                        /* misc flags (see below)                            */
  238.     UInt8                             warningLevel;                /* scaled warning level (0-255)                        */
  239.     UInt8                             reserved;                    /* reserved for internal use                        */
  240.     UInt8                             batteryLevel;                /* scaled battery level (0-255)                        */
  241. };
  242. typedef struct BatteryInfo                BatteryInfo;
  243.  
  244. typedef SInt8                             ModemByte;
  245. typedef SInt8                             BatteryByte;
  246. typedef SInt8                             SoundMixerByte;
  247. typedef long                             PMResultCode;
  248. typedef struct SleepQRec                 SleepQRec;
  249. typedef SleepQRec *                        SleepQRecPtr;
  250. typedef struct HDQueueElement             HDQueueElement;
  251. typedef struct PMgrQueueElement         PMgrQueueElement;
  252. typedef CALLBACK_API( long , SleepQProcPtr )(long message, SleepQRecPtr qRecPtr);
  253. /*
  254.     WARNING: SleepQProcPtr uses register based parameters under classic 68k
  255.              and cannot be written in a high-level language without 
  256.              the help of mixed mode or assembly glue.
  257. */
  258. typedef CALLBACK_API( void , HDSpindownProcPtr )(HDQueueElement *theElement);
  259. typedef CALLBACK_API( void , PMgrStateChangeProcPtr )(PMgrQueueElement *theElement, long stateBits);
  260. typedef REGISTER_UPP_TYPE(SleepQProcPtr)                         SleepQUPP;
  261. typedef STACK_UPP_TYPE(HDSpindownProcPtr)                         HDSpindownUPP;
  262. typedef STACK_UPP_TYPE(PMgrStateChangeProcPtr)                     PMgrStateChangeUPP;
  263.  
  264. struct SleepQRec {
  265.     SleepQRecPtr                     sleepQLink;                    /* pointer to next queue element                */
  266.     short                             sleepQType;                    /* queue element type (must be SleepQType)        */
  267.     SleepQUPP                         sleepQProc;                    /* pointer to sleep universal proc ptr            */
  268.     short                             sleepQFlags;                /* flags                                        */
  269. };
  270.  
  271.  
  272. struct HDQueueElement {
  273.     struct HDQueueElement *            hdQLink;                    /* pointer to next queue element                */
  274.     short                             hdQType;                    /* queue element type (must be HDPwrQType)        */
  275.     short                             hdFlags;                    /* miscellaneous flags                            */
  276.     HDSpindownUPP                     hdProc;                        /* pointer to routine to call                    */
  277.     long                             hdUser;                        /* user-defined (variable storage, etc.)        */
  278. };
  279.  
  280.  
  281. struct PMgrQueueElement {
  282.     struct PMgrQueueElement *        pmQLink;                    /* pointer to next queue element                */
  283.     short                             pmQType;                    /* queue element type (must be PMgrStateQType)    */
  284.     short                             pmFlags;                    /* miscellaneous flags                            */
  285.     long                             pmNotifyBits;                /* bitmap of which changes to be notified for    */
  286.     PMgrStateChangeUPP                 pmProc;                        /* pointer to routine to call                    */
  287.     long                             pmUser;                        /* user-defined (variable storage, etc.)        */
  288. };
  289.  
  290.  
  291.  
  292. struct BatteryTimeRec {
  293.     unsigned long                     expectedBatteryTime;        /* estimated battery time remaining (seconds)    */
  294.     unsigned long                     minimumBatteryTime;            /* minimum battery time remaining (seconds)        */
  295.     unsigned long                     maximumBatteryTime;            /* maximum battery time remaining (seconds)        */
  296.     unsigned long                     timeUntilCharged;            /* time until battery is fully charged (seconds)*/
  297. };
  298. typedef struct BatteryTimeRec            BatteryTimeRec;
  299.  
  300.  
  301. struct WakeupTime {
  302.     unsigned long                     wakeTime;                    /* wakeup time (same format as current time)        */
  303.     Boolean                         wakeEnabled;                /* 1=enable wakeup timer, 0=disable wakeup timer    */
  304.     SInt8                             filler;
  305. };
  306. typedef struct WakeupTime                WakeupTime;
  307.  
  308.  
  309. struct StartupTime {
  310.     unsigned long                     startTime;                    /* startup time (same format as current time)        */
  311.     Boolean                         startEnabled;                /* 1=enable startup timer, 0=disable startup timer    */
  312.     SInt8                             filler;
  313. };
  314. typedef struct StartupTime                StartupTime;
  315. EXTERN_API( OSErr )
  316. DisableWUTime                    (void);
  317.  
  318. EXTERN_API( OSErr )
  319. SetWUTime                        (long                     WUTime);
  320.  
  321. EXTERN_API( OSErr )
  322. GetWUTime                        (long *                    WUTime,
  323.                                  Byte *                    WUFlag);
  324.  
  325. EXTERN_API( OSErr )
  326. BatteryStatus                    (Byte *                    Status,
  327.                                  Byte *                    Power);
  328.  
  329. EXTERN_API( OSErr )
  330. ModemStatus                        (Byte *                    Status);
  331.  
  332.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  333.                                                                                             #pragma parameter __D0 IdleUpdate
  334.                                                                                             #endif
  335. EXTERN_API( long )
  336. IdleUpdate                        (void)                                                        ONEWORDINLINE(0xA285);
  337.  
  338.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  339.                                                                                             #pragma parameter __D0 GetCPUSpeed
  340.                                                                                             #endif
  341. EXTERN_API( long )
  342. GetCPUSpeed                        (void)                                                        TWOWORDINLINE(0x70FF, 0xA485);
  343.  
  344. EXTERN_API( void )
  345. EnableIdle                        (void)                                                        TWOWORDINLINE(0x7000, 0xA485);
  346.  
  347. EXTERN_API( void )
  348. DisableIdle                        (void)                                                        TWOWORDINLINE(0x7001, 0xA485);
  349.  
  350.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  351.                                                                                             #pragma parameter SleepQInstall(__A0)
  352.                                                                                             #endif
  353. EXTERN_API( void )
  354. SleepQInstall                    (SleepQRecPtr             qRecPtr)                            ONEWORDINLINE(0xA28A);
  355.  
  356.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  357.                                                                                             #pragma parameter SleepQRemove(__A0)
  358.                                                                                             #endif
  359. EXTERN_API( void )
  360. SleepQRemove                    (SleepQRecPtr             qRecPtr)                            ONEWORDINLINE(0xA48A);
  361.  
  362. EXTERN_API( void )
  363. AOn                                (void)                                                        TWOWORDINLINE(0x7004, 0xA685);
  364.  
  365. EXTERN_API( void )
  366. AOnIgnoreModem                    (void)                                                        TWOWORDINLINE(0x7005, 0xA685);
  367.  
  368. EXTERN_API( void )
  369. BOn                                (void)                                                        TWOWORDINLINE(0x7000, 0xA685);
  370.  
  371. EXTERN_API( void )
  372. AOff                            (void)                                                        TWOWORDINLINE(0x7084, 0xA685);
  373.  
  374. EXTERN_API( void )
  375. BOff                            (void)                                                        TWOWORDINLINE(0x7080, 0xA685);
  376.  
  377.  
  378. /* Public Power Management API (NEW!) */
  379.  
  380.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  381.                                                                                             #pragma parameter __D0 PMSelectorCount
  382.                                                                                             #endif
  383. EXTERN_API( short )
  384. PMSelectorCount                    (void)                                                        TWOWORDINLINE(0x7000, 0xA09E);
  385.  
  386.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  387.                                                                                             #pragma parameter __D0 PMFeatures
  388.                                                                                             #endif
  389. EXTERN_API( unsigned long )
  390. PMFeatures                        (void)                                                        TWOWORDINLINE(0x7001, 0xA09E);
  391.  
  392.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  393.                                                                                             #pragma parameter __D0 GetSleepTimeout
  394.                                                                                             #endif
  395. EXTERN_API( UInt8 )
  396. GetSleepTimeout                    (void)                                                        TWOWORDINLINE(0x7002, 0xA09E);
  397.  
  398.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  399.                                                                                             #pragma parameter SetSleepTimeout(__D0)
  400.                                                                                             #endif
  401. EXTERN_API( void )
  402. SetSleepTimeout                    (UInt8                     timeout)                            FOURWORDINLINE(0x4840, 0x303C, 0x0003, 0xA09E);
  403.  
  404.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  405.                                                                                             #pragma parameter __D0 GetHardDiskTimeout
  406.                                                                                             #endif
  407. EXTERN_API( UInt8 )
  408. GetHardDiskTimeout                (void)                                                        TWOWORDINLINE(0x7004, 0xA09E);
  409.  
  410.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  411.                                                                                             #pragma parameter SetHardDiskTimeout(__D0)
  412.                                                                                             #endif
  413. EXTERN_API( void )
  414. SetHardDiskTimeout                (UInt8                     timeout)                            FOURWORDINLINE(0x4840, 0x303C, 0x0005, 0xA09E);
  415.  
  416.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  417.                                                                                             #pragma parameter __D0 HardDiskPowered
  418.                                                                                             #endif
  419. EXTERN_API( Boolean )
  420. HardDiskPowered                    (void)                                                        TWOWORDINLINE(0x7006, 0xA09E);
  421.  
  422.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  423.                                                                                             #pragma parameter SpinDownHardDisk
  424.                                                                                             #endif
  425. EXTERN_API( void )
  426. SpinDownHardDisk                (void)                                                        TWOWORDINLINE(0x7007, 0xA09E);
  427.  
  428.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  429.                                                                                             #pragma parameter __D0 IsSpindownDisabled
  430.                                                                                             #endif
  431. EXTERN_API( Boolean )
  432. IsSpindownDisabled                (void)                                                        TWOWORDINLINE(0x7008, 0xA09E);
  433.  
  434.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  435.                                                                                             #pragma parameter SetSpindownDisable(__D0)
  436.                                                                                             #endif
  437. EXTERN_API( void )
  438. SetSpindownDisable                (Boolean                 setDisable)                            FOURWORDINLINE(0x4840, 0x303C, 0x0009, 0xA09E);
  439.  
  440.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  441.                                                                                             #pragma parameter __D0 HardDiskQInstall(__A0)
  442.                                                                                             #endif
  443. EXTERN_API( OSErr )
  444. HardDiskQInstall                (HDQueueElement *        theElement)                            TWOWORDINLINE(0x700A, 0xA09E);
  445.  
  446.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  447.                                                                                             #pragma parameter __D0 HardDiskQRemove(__A0)
  448.                                                                                             #endif
  449. EXTERN_API( OSErr )
  450. HardDiskQRemove                    (HDQueueElement *        theElement)                            TWOWORDINLINE(0x700B, 0xA09E);
  451.  
  452.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  453.                                                                                             #pragma parameter GetScaledBatteryInfo(__D0, __A0)
  454.                                                                                             #endif
  455. EXTERN_API( void )
  456. GetScaledBatteryInfo            (short                     whichBattery,
  457.                                  BatteryInfo *            theInfo)                            FIVEWORDINLINE(0x4840, 0x303C, 0x000C, 0xA09E, 0x2080);
  458.  
  459.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  460.                                                                                             #pragma parameter AutoSleepControl(__D0)
  461.                                                                                             #endif
  462. EXTERN_API( void )
  463. AutoSleepControl                (Boolean                 enableSleep)                        FOURWORDINLINE(0x4840, 0x303C, 0x000D, 0xA09E);
  464.  
  465.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  466.                                                                                             #pragma parameter __D0 GetIntModemInfo
  467.                                                                                             #endif
  468. EXTERN_API( unsigned long )
  469. GetIntModemInfo                    (void)                                                        TWOWORDINLINE(0x700E, 0xA09E);
  470.  
  471.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  472.                                                                                             #pragma parameter SetIntModemState(__D0)
  473.                                                                                             #endif
  474. EXTERN_API( void )
  475. SetIntModemState                (short                     theState)                            FOURWORDINLINE(0x4840, 0x303C, 0x000F, 0xA09E);
  476.  
  477.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  478.                                                                                             #pragma parameter __D0 MaximumProcessorSpeed
  479.                                                                                             #endif
  480. EXTERN_API( short )
  481. MaximumProcessorSpeed            (void)                                                        TWOWORDINLINE(0x7010, 0xA09E);
  482.  
  483.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  484.                                                                                             #pragma parameter __D0 CurrentProcessorSpeed
  485.                                                                                             #endif
  486. EXTERN_API( short )
  487. CurrentProcessorSpeed            (void)                                                        TWOWORDINLINE(0x7011, 0xA09E);
  488.  
  489.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  490.                                                                                             #pragma parameter __D0 FullProcessorSpeed
  491.                                                                                             #endif
  492. EXTERN_API( Boolean )
  493. FullProcessorSpeed                (void)                                                        TWOWORDINLINE(0x7012, 0xA09E);
  494.  
  495.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  496.                                                                                             #pragma parameter __D0 SetProcessorSpeed(__D0)
  497.                                                                                             #endif
  498. EXTERN_API( Boolean )
  499. SetProcessorSpeed                (Boolean                 fullSpeed)                            FOURWORDINLINE(0x4840, 0x303C, 0x0013, 0xA09E);
  500.  
  501.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  502.                                                                                             #pragma parameter __D0 GetSCSIDiskModeAddress
  503.                                                                                             #endif
  504. EXTERN_API( short )
  505. GetSCSIDiskModeAddress            (void)                                                        TWOWORDINLINE(0x7014, 0xA09E);
  506.  
  507.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  508.                                                                                             #pragma parameter SetSCSIDiskModeAddress(__D0)
  509.                                                                                             #endif
  510. EXTERN_API( void )
  511. SetSCSIDiskModeAddress            (short                     scsiAddress)                        FOURWORDINLINE(0x4840, 0x303C, 0x0015, 0xA09E);
  512.  
  513.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  514.                                                                                             #pragma parameter GetWakeupTimer(__A0)
  515.                                                                                             #endif
  516. EXTERN_API( void )
  517. GetWakeupTimer                    (WakeupTime *            theTime)                            TWOWORDINLINE(0x7016, 0xA09E);
  518.  
  519.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  520.                                                                                             #pragma parameter SetWakeupTimer(__A0)
  521.                                                                                             #endif
  522. EXTERN_API( void )
  523. SetWakeupTimer                    (WakeupTime *            theTime)                            TWOWORDINLINE(0x7017, 0xA09E);
  524.  
  525.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  526.                                                                                             #pragma parameter __D0 IsProcessorCyclingEnabled
  527.                                                                                             #endif
  528. EXTERN_API( Boolean )
  529. IsProcessorCyclingEnabled        (void)                                                        TWOWORDINLINE(0x7018, 0xA09E);
  530.  
  531.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  532.                                                                                             #pragma parameter EnableProcessorCycling(__D0)
  533.                                                                                             #endif
  534. EXTERN_API( void )
  535. EnableProcessorCycling            (Boolean                 enable)                                FOURWORDINLINE(0x4840, 0x303C, 0x0019, 0xA09E);
  536.  
  537.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  538.                                                                                             #pragma parameter __D0 BatteryCount
  539.                                                                                             #endif
  540. EXTERN_API( short )
  541. BatteryCount                    (void)                                                        TWOWORDINLINE(0x701A, 0xA09E);
  542.  
  543.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  544.                                                                                             #pragma parameter __D0 GetBatteryVoltage(__D0)
  545.                                                                                             #endif
  546. EXTERN_API( Fixed )
  547. GetBatteryVoltage                (short                     whichBattery)                        FOURWORDINLINE(0x4840, 0x303C, 0x001B, 0xA09E);
  548.  
  549.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  550.                                                                                             #pragma parameter GetBatteryTimes(__D0, __A0)
  551.                                                                                             #endif
  552. EXTERN_API( void )
  553. GetBatteryTimes                    (short                     whichBattery,
  554.                                  BatteryTimeRec *        theTimes)                            FOURWORDINLINE(0x4840, 0x303C, 0x001C, 0xA09E);
  555.  
  556.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  557.                                                                                             #pragma parameter __D0 GetDimmingTimeout
  558.                                                                                             #endif
  559. EXTERN_API( UInt8 )
  560. GetDimmingTimeout                (void)                                                        TWOWORDINLINE(0x701D, 0xA09E);
  561.  
  562.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  563.                                                                                             #pragma parameter SetDimmingTimeout(__D0)
  564.                                                                                             #endif
  565. EXTERN_API( void )
  566. SetDimmingTimeout                (UInt8                     timeout)                            FOURWORDINLINE(0x4840, 0x303C, 0x001E, 0xA09E);
  567.  
  568.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  569.                                                                                             #pragma parameter DimmingControl(__D0)
  570.                                                                                             #endif
  571. EXTERN_API( void )
  572. DimmingControl                    (Boolean                 enableSleep)                        FOURWORDINLINE(0x4840, 0x303C, 0x001F, 0xA09E);
  573.  
  574.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  575.                                                                                             #pragma parameter __D0 IsDimmingControlDisabled
  576.                                                                                             #endif
  577. EXTERN_API( Boolean )
  578. IsDimmingControlDisabled        (void)                                                        TWOWORDINLINE(0x7020, 0xA09E);
  579.  
  580.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  581.                                                                                             #pragma parameter __D0 IsAutoSlpControlDisabled
  582.                                                                                             #endif
  583. EXTERN_API( Boolean )
  584. IsAutoSlpControlDisabled        (void)                                                        TWOWORDINLINE(0x7021, 0xA09E);
  585.  
  586.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  587.                                                                                             #pragma parameter __D0 PMgrStateQInstall(__A0)
  588.                                                                                             #endif
  589. EXTERN_API( OSErr )
  590. PMgrStateQInstall                (PMgrQueueElement *        theElement)                            TWOWORDINLINE(0x7022, 0xA09E);
  591.  
  592.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  593.                                                                                             #pragma parameter __D0 PMgrStateQRemove(__A0)
  594.                                                                                             #endif
  595. EXTERN_API( OSErr )
  596. PMgrStateQRemove                (PMgrQueueElement *        theElement)                            TWOWORDINLINE(0x7023, 0xA09E);
  597.  
  598.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  599.                                                                                             #pragma parameter __D0 UpdateSystemActivity(__D0)
  600.                                                                                             #endif
  601. EXTERN_API( OSErr )
  602. UpdateSystemActivity            (UInt8                     activity)                            FOURWORDINLINE(0x4840, 0x303C, 0x0024, 0xA09E);
  603.  
  604.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  605.                                                                                             #pragma parameter __D0 DelaySystemIdle
  606.                                                                                             #endif
  607. EXTERN_API( OSErr )
  608. DelaySystemIdle                    (void)                                                        TWOWORDINLINE(0x7025, 0xA09E);
  609.  
  610.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  611.                                                                                             #pragma parameter __D0 GetStartupTimer(__A0)
  612.                                                                                             #endif
  613. EXTERN_API( OSErr )
  614. GetStartupTimer                    (StartupTime *            theTime)                            TWOWORDINLINE(0x7026, 0xA09E);
  615.  
  616.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  617.                                                                                             #pragma parameter __D0 SetStartupTimer(__A0)
  618.                                                                                             #endif
  619. EXTERN_API( OSErr )
  620. SetStartupTimer                    (StartupTime *            theTime)                            TWOWORDINLINE(0x7027, 0xA09E);
  621.  
  622.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  623.                                                                                             #pragma parameter __D0 GetLastActivity(__A0)
  624.                                                                                             #endif
  625. EXTERN_API( OSErr )
  626. GetLastActivity                    (ActivityInfo *            theActivity)                        TWOWORDINLINE(0x7028, 0xA09E);
  627.  
  628.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  629.                                                                                             #pragma parameter __D0 GetSoundMixerState(__A0)
  630.                                                                                             #endif
  631. EXTERN_API( OSErr )
  632. GetSoundMixerState                (SoundMixerByte *        theSoundMixerByte)                    TWOWORDINLINE(0x7029, 0xA09E);
  633.  
  634.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  635.                                                                                             #pragma parameter __D0 SetSoundMixerState(__A0)
  636.                                                                                             #endif
  637. EXTERN_API( OSErr )
  638. SetSoundMixerState                (SoundMixerByte *        theSoundMixerByte)                    TWOWORDINLINE(0x702A, 0xA09E);
  639.  
  640.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  641.                                                                                             #pragma parameter __D0 GetDimSuspendState
  642.                                                                                             #endif
  643. EXTERN_API( Boolean )
  644. GetDimSuspendState                (void)                                                        TWOWORDINLINE(0x702B, 0xA09E);
  645.  
  646.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  647.                                                                                             #pragma parameter SetDimSuspendState(__D0)
  648.                                                                                             #endif
  649. EXTERN_API( void )
  650. SetDimSuspendState                (Boolean                 dimSuspendState)                    FOURWORDINLINE(0x4840, 0x303C, 0x002C, 0xA09E);
  651.  
  652. enum { uppSleepQProcInfo = 0x00131832 };                         /* register 4_bytes:D0 Func(4_bytes:D0, 4_bytes:A0) */
  653. enum { uppHDSpindownProcInfo = 0x000000C0 };                     /* pascal no_return_value Func(4_bytes) */
  654. enum { uppPMgrStateChangeProcInfo = 0x000003C0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes) */
  655. #define NewSleepQProc(userRoutine)                                 (SleepQUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSleepQProcInfo, GetCurrentArchitecture())
  656. #define NewHDSpindownProc(userRoutine)                             (HDSpindownUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppHDSpindownProcInfo, GetCurrentArchitecture())
  657. #define NewPMgrStateChangeProc(userRoutine)                     (PMgrStateChangeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPMgrStateChangeProcInfo, GetCurrentArchitecture())
  658. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  659.     #pragma parameter __D0 CallSleepQProc(__A1, __D0, __A0)
  660.     long CallSleepQProc(SleepQUPP routine, long message, SleepQRecPtr qRecPtr) = 0x4E91;
  661. #else
  662.     #define CallSleepQProc(userRoutine, message, qRecPtr)         CALL_TWO_PARAMETER_UPP((userRoutine), uppSleepQProcInfo, (message), (qRecPtr))
  663. #endif
  664. #define CallHDSpindownProc(userRoutine, theElement)             CALL_ONE_PARAMETER_UPP((userRoutine), uppHDSpindownProcInfo, (theElement))
  665. #define CallPMgrStateChangeProc(userRoutine, theElement, stateBits)  CALL_TWO_PARAMETER_UPP((userRoutine), uppPMgrStateChangeProcInfo, (theElement), (stateBits))
  666.  
  667.  
  668. #if PRAGMA_STRUCT_ALIGN
  669.     #pragma options align=reset
  670. #elif PRAGMA_STRUCT_PACKPUSH
  671.     #pragma pack(pop)
  672. #elif PRAGMA_STRUCT_PACK
  673.     #pragma pack()
  674. #endif
  675.  
  676. #ifdef PRAGMA_IMPORT_OFF
  677. #pragma import off
  678. #elif PRAGMA_IMPORT
  679. #pragma import reset
  680. #endif
  681.  
  682. #ifdef __cplusplus
  683. }
  684. #endif
  685.  
  686. #endif /* __POWER__ */
  687.  
  688.